<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员首页 - 学生管理系统</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        .sidebar {
            min-height: 100vh;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .sidebar .nav-link {
            color: rgba(255, 255, 255, 0.8);
            padding: 12px 20px;
            border-radius: 8px;
            margin: 5px 10px;
            transition: all 0.3s;
        }
        .sidebar .nav-link:hover,
        .sidebar .nav-link.active {
            color: white;
            background: rgba(255, 255, 255, 0.2);
            transform: translateX(5px);
        }
        .main-content {
            background: #f8f9fa;
            min-height: 100vh;
        }
        .stat-card {
            background: white;
            border-radius: 15px;
            padding: 2rem;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
            transition: transform 0.3s;
        }
        .stat-card:hover {
            transform: translateY(-5px);
        }
        .stat-icon {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            color: white;
        }
        .stat-icon.students { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
        .stat-icon.teachers { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
        .stat-icon.courses { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
    </style>
</head>
<body>
    <div class="container-fluid">
        <div class="row">
            <!-- 侧边栏 -->
            <div class="col-md-3 col-lg-2 px-0">
                <div class="sidebar">
                    <div class="p-3">
                        <h4 class="text-white mb-4">
                            <i class="bi bi-gear-fill me-2"></i>管理员面板
                        </h4>
                        <nav class="nav flex-column">
                            <a class="nav-link active" href="/admin/dashboard">
                                <i class="bi bi-house-door me-2"></i>首页
                            </a>
                            <a class="nav-link" href="/admin/students">
                                <i class="bi bi-people me-2"></i>学生管理
                            </a>
                            <a class="nav-link" href="/admin/teachers">
                                <i class="bi bi-person-badge me-2"></i>教师管理
                            </a>
                            <a class="nav-link" href="/admin/courses">
                                <i class="bi bi-book me-2"></i>课程管理
                            </a>
                            <hr class="text-white-50">
                            <a class="nav-link" href="/logout">
                                <i class="bi bi-box-arrow-right me-2"></i>退出登录
                            </a>
                        </nav>
                    </div>
                </div>
            </div>
            
            <!-- 主内容区 -->
            <div class="col-md-9 col-lg-10">
                <div class="main-content">
                    <div class="p-4">
                        <div class="d-flex justify-content-between align-items-center mb-4">
                            <h2 class="mb-0">系统概览</h2>
                            <span class="text-muted">欢迎回来，管理员</span>
                        </div>
                        
                        <!-- 统计卡片 -->
                        <div class="row g-4 mb-4">
                            <div class="col-md-4">
                                <div class="stat-card">
                                    <div class="d-flex align-items-center">
                                        <div class="stat-icon students me-3">
                                            <i class="bi bi-people"></i>
                                        </div>
                                        <div>
                                            <h3 class="mb-0" th:text="${studentCount}">0</h3>
                                            <p class="text-muted mb-0">学生总数</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="stat-card">
                                    <div class="d-flex align-items-center">
                                        <div class="stat-icon teachers me-3">
                                            <i class="bi bi-person-badge"></i>
                                        </div>
                                        <div>
                                            <h3 class="mb-0" th:text="${teacherCount}">0</h3>
                                            <p class="text-muted mb-0">教师总数</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="stat-card">
                                    <div class="d-flex align-items-center">
                                        <div class="stat-icon courses me-3">
                                            <i class="bi bi-book"></i>
                                        </div>
                                        <div>
                                            <h3 class="mb-0" th:text="${courseCount}">0</h3>
                                            <p class="text-muted mb-0">课程总数</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        
                        <!-- 快速操作 -->
                        <div class="row">
                            <div class="col-12">
                                <div class="card">
                                    <div class="card-header">
                                        <h5 class="mb-0">快速操作</h5>
                                    </div>
                                    <div class="card-body">
                                        <div class="row g-3">
                                            <div class="col-md-4">
                                                <a href="/admin/students/add" class="btn btn-outline-primary w-100">
                                                    <i class="bi bi-person-plus me-2"></i>添加学生
                                                </a>
                                            </div>
                                            <div class="col-md-4">
                                                <a href="/admin/teachers/add" class="btn btn-outline-success w-100">
                                                    <i class="bi bi-person-plus me-2"></i>添加教师
                                                </a>
                                            </div>
                                            <div class="col-md-4">
                                                <a href="/admin/courses/add" class="btn btn-outline-info w-100">
                                                    <i class="bi bi-plus-circle me-2"></i>添加课程
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
